package cn.com.b2office.bean;

/**
 * 
 * @author wangtao.upc@gmail.com
 * 
 */
public class ItemQueryParam {
	private String categoryId = null;

	private String brandId = null;

	/**
	 * 按照什么排序
	 */
	private String sortFactor = null;

	/**
	 * 0 asc 1 desc 默认倒序
	 */
	private int sortSeq = 1;

	private int pageSize = 20;

	private int pageCount = 0;

	public String getBrandId() {
		return brandId;
	}

	public void setBrandId(String brandId) {
		this.brandId = brandId;
	}

	public String getCategoryId() {
		return categoryId;
	}

	public void setCategoryId(String categoryId) {
		this.categoryId = categoryId;
	}

	public int getPageCount() {
		return pageCount;
	}

	public void setPageCount(int pageCount) {
		this.pageCount = pageCount;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public int getSortSeq() {
		return sortSeq;
	}

	public void setSortSeq(int sortSeq) {
		this.sortSeq = sortSeq;
	}

	public String getSortFactor() {
		return sortFactor;
	}

	public void setSortFactor(String sortFactor) {
		this.sortFactor = sortFactor;
	}

	public int getFirstResult() {
		if (pageCount < 1)
			pageCount = 1;
		if (pageSize == 0)
			pageSize = 20;
		return (pageCount - 1) * pageSize;
	}

}
